#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N=2e5;
const int maxn=1e6;
typedef long long int ll;
using namespace std;
//----------------------------------------------------------------------------//
int arr[1005];
void solve()
{
    int n;
    sd(n);
    int sum=0;
    for(int i=0;i<n;i++)
        sd(arr[i]),sum+=arr[i];

    for(int i=0;i<n;i++)
    {
        if(fabs(sum*1.0/n-1.0*arr[i])<1e-6)
        {
            cout<<"YES"<<'\n';
            return;
        }
    }
    cout<<"NO"<<'\n';

}

int main()
{
    int T;
    sd(T);
    while (T--)
    {
        solve();
    }
    return 0;
}